Adding more features to main container and solving problems of nested
javascript code.