refactoring. implementing more angular approach.