stable. now refactor!