refactor repo writing slightly