solidfied the use of _state and baseUrl; some code cleanup

see commit logs