Simplified the functions for sequence handling.