refactor code in Context to States, remove unused method @jonferraiolo