I think these functions should be divided. 
These function isn't work same